package com.chkj.fbook.common.controller;

import javax.servlet.http.HttpServletRequest;

import com.chkj.fbook.common.utils.HttpContextUtils;
import com.chkj.fbook.common.utils.SessionUtils;
import org.springframework.stereotype.Controller;

import com.chkj.fbook.system.domain.UserDO;

@Controller
public class BaseController {
	public UserDO getUser() {
		HttpServletRequest request = HttpContextUtils.getHttpServletRequest();
		UserDO sessionUser = SessionUtils.getSessionUser(request);
		return sessionUser;
	}

	public UserDO getUserDO() {
		return getUser();
	}

	public String getUserId() {
		return getUser().getUserId();
	}

	public String getUsername() {
		return getUser().getUsername();
	}

}